From d92b48cfd3720bcec0daa60d2dd0fca2c375e2ca Mon Sep 17 00:00:00 2001 From: Alex Williamson Date: Mon, 10 Mar 2008 11:50:59 -0600 Subject: [PATCH] [IA64] Switch to VPS save/restore for HVM Replace pal_vp_save/restore with vps_save/restore. The latter have better performance. Signed-off-by: Anthony Xu --- xen/arch/ia64/vmx/vmx_init.c | 16 ++++------------ xen/include/asm-ia64/vmx_pal_vsa.h | 2 ++ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/xen/arch/ia64/vmx/vmx_init.c b/xen/arch/ia64/vmx/vmx_init.c index 98eed43c4d..c279595b8f 100644 --- a/xen/arch/ia64/vmx/vmx_init.c +++ b/xen/arch/ia64/vmx/vmx_init.c @@ -52,6 +52,7 @@ #include #include #include +#include #include "entry.h" /* Global flag to identify whether Intel vmx feature is on */ @@ -308,12 +309,8 @@ vmx_save_state(struct vcpu *v) u64 status; BUG_ON(v != current); - /* FIXME: about setting of pal_proc_vector... time consuming */ - status = ia64_pal_vp_save((u64 *)v->arch.privregs, 0); - if (status != PAL_STATUS_SUCCESS){ - panic_domain(vcpu_regs(v),"Save vp status failed\n"); - } - + + ia64_call_vsa(PAL_VPS_SAVE, v->arch.privregs, 0, 0, 0, 0, 0, 0); /* Need to save KR when domain switch, though HV itself doesn;t * use them. @@ -332,17 +329,12 @@ vmx_save_state(struct vcpu *v) void vmx_load_state(struct vcpu *v) { - u64 status; - BUG_ON(v != current); vmx_load_all_rr(v); /* vmx_load_all_rr() pins down v->arch.privregs with both dtr/itr*/ - status = ia64_pal_vp_restore((u64 *)v->arch.privregs, 0); - if (status != PAL_STATUS_SUCCESS){ - panic_domain(vcpu_regs(v),"Restore vp status failed\n"); - } + ia64_call_vsa(PAL_VPS_RESTORE, v->arch.privregs, 0, 0, 0, 0, 0, 0); ia64_set_kr(0, v->arch.arch_vmx.vkr[0]); ia64_set_kr(1, v->arch.arch_vmx.vkr[1]); diff --git a/xen/include/asm-ia64/vmx_pal_vsa.h b/xen/include/asm-ia64/vmx_pal_vsa.h index 7ce8069501..612f5ab0b0 100644 --- a/xen/include/asm-ia64/vmx_pal_vsa.h +++ b/xen/include/asm-ia64/vmx_pal_vsa.h @@ -38,6 +38,8 @@ extern u64 __vsa_base; #define PAL_VPS_SET_PENDING_INTERRUPT 0x1000 #define PAL_VPS_THASH 0x1400 #define PAL_VPS_TTAG 0x1800 +#define PAL_VPS_RESTORE 0x1c00 +#define PAL_VPS_SAVE 0x2000 #endif /* _PAL_VSA_H_ */ -- 2.30.2